﻿unit GetRListFrm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, JvExControls, JvXPCore, JvXPButtons, ExtCtrls, GridsEh, DBGridEh, DB,
  FIBDataSet, pFIBDataSet;

type
  TGetRListForm = class(TForm)
    Panel1: TPanel;
    JvXPButton1: TJvXPButton;
    JvXPButton2: TJvXPButton;
    Grid: TDBGridEh;
    DS: TpFIBDataSet;
    DataSource: TDataSource;
    procedure GridKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure JvXPButton1Click(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
  private
    fEType: string;
    fENext: string;
    procedure SetEType(const Value: string);
  public
    property EType: string read fEType write SetEType;
    procedure OpenDS;
  end;

var
  GetRListForm: TGetRListForm;

implementation
 uses  DModule;

{$R *.dfm}

procedure TGetRListForm.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 case Key of
  VK_CANCEL: ModalResult:=mrCancel; 
 end;
end;

procedure TGetRListForm.GridKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 case Key of
  VK_ESCAPE: ModalResult:=mrCancel;
 end;
end;

procedure TGetRListForm.JvXPButton1Click(Sender: TObject);
begin
 if DS.IsEmpty then
  begin
   ModalResult:=mrNone;
   Exit;
  end;
end;

procedure TGetRListForm.OpenDS;
begin
 DS.ParamByName('EType').AsString:=EType;
 DS.CloseOpen(true);
end;

procedure TGetRListForm.SetEType(const Value: string);
begin
  fEType := Value;
  OpenDS;
end;

end.
